import { Result, deleteRequest, get, post, put } from "../base";

/**
 * 分页查询
 * @param query .
 * @returns .
 */
export function msgList<T>(): Promise<Result<T>> {
  return get("/sci/msg");
}
export function msgListRecent<T>(): Promise<Result<T>> {
  return get("/sci/msg/recent");
}
/**
 * 新增
 * @param data .
 * @returns .
 */
export function saveMessage<T>(data: any): Promise<Result<T>> {
  return post("/sci/msg/save", data);
}
/**
 * 更新
 * @param id .
 * @param data .
 * @returns  .
 */
export function update<T>(isPass: number, data: any): Promise<Result<T>> {
  return put(`/sci/msg/update/${isPass}`, {}, data);
}

/**
 * 删除消息
 * @param userIds .
 * @returns
 */
export function del<T>(msgIds: string[]): Promise<Result<T>> {
  return deleteRequest(`/sci/msg/delete`, {}, msgIds);
}

export function delQuash<T>(data: any): Promise<Result<T>> {
  return deleteRequest(`/sci/msg/deleteQuash`, {}, data);
}
